require 'erb'
require 'common/base'

class NFSBase < Base

  attr_accessor :step, :transport, :base_options, :base_transports, :base_variables, :message

  def initialize(step, filename, params = {}, transport="NFS")
    super()
    @transport = transport
    @step = step
    @path = params["path"] or ""

    @base_options = "
     $path='<%= @path %>'"

    @base_variables = ''

    @base_transports = '
       Portmap = udp(dst_port: 111)
       NFS = udp(dst_port: 2049, type: server)
       MOUNT = udp(dst_port: 12345, type: server)'

    if !filename.nil?
      template = get_message("NFS", filename)
      erb = ERB.new(template, 0, '%<>')
      @message = erb.result(binding)
    end
  end
end
